package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.DingBundleRankEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @author chenshan
 * @Since 2020-09-01 13:44
 */
@Repository
@Mapper
public interface DingBundleRankDao {
	Integer insert(DingBundleRankEntity DingBundleRank);

	void insertBatch(List<DingBundleRankEntity> DingBundleRankList);

	Integer update(DingBundleRankEntity DingBundleRank);

	Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);

	DingBundleRankEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid);

	List<DingBundleRankEntity>	findEntitys(@Param("param") Map<String, Object> param);
    
    Integer deleteByRankTime(@Param("corpid") String corpid,@Param("openConversationId")String openConversationId,@Param("rankTimeStart") Long rankTimeStart, @Param("rankTimeEnd") Long rankTimeEnd);
    
    Integer getEntitysCount(@Param("param") Map<String, Object> param);

	Integer deleteByIdIn(@Param("idIn") List<Long> idIn, @Param("corpid") String corpid);
	
	Integer updateBatch(@Param("idIn") List<Long> idIn, @Param("corpid") String corpid,@Param("isPush") Integer isPush,@Param("pushUrl") String pushUrl);

	Integer dataConsistencyUpdateUser(@Param("corpid") String corpid, @Param("userId") String userId, @Param("name") String name, @Param("avatar") String avatar);
}